<!DOCTYPE html>
<html class="writer-html4" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>p4utils.mininetlib.network_API module &mdash; P4-Utils 1.0 documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
      <script>
          var DOCUMENTATION_OPTIONS = {
              URL_ROOT:'./',
              VERSION:'1.0',
              LANGUAGE:'None',
              COLLAPSE_INDEX:false,
              FILE_SUFFIX:'.html',
              HAS_SOURCE:  false,
              SOURCELINK_SUFFIX: '.txt'
          };
      </script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/doctools.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="p4utils.mininetlib.node module" href="p4utils.mininetlib.node.html" />
    <link rel="prev" title="p4utils.mininetlib.net module" href="p4utils.mininetlib.net.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="index.html" class="icon icon-home"> P4-Utils
          </a>
              <div class="version">
                1.0
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption"><span class="caption-text">General Documentation</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage.html">Advanced Usage</a></li>
</ul>
<p class="caption"><span class="caption-text">API Reference</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="p4utils.html">P4-Utils API reference</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="p4utils.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="p4utils.mininetlib.html">p4utils.mininetlib package</a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="p4utils.mininetlib.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="p4utils.mininetlib.html#module-p4utils.mininetlib">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="p4utils.utils.html">p4utils.utils package</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="p4utils.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="p4utils.html#module-p4utils">Module contents</a></li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">P4-Utils</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
          <li><a href="p4utils.html">P4-Utils API reference</a> &raquo;</li>
          <li><a href="p4utils.mininetlib.html">p4utils.mininetlib package</a> &raquo;</li>
      <li>p4utils.mininetlib.network_API module</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/nsg-ethz/p4-utils/blob/master/docs/source/p4utils.mininetlib.network_API.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <div class="section" id="module-p4utils.mininetlib.network_API">
<span id="p4utils-mininetlib-network-api-module"></span><h1>p4utils.mininetlib.network_API module<a class="headerlink" href="#module-p4utils.mininetlib.network_API" title="Permalink to this headline">¶</a></h1>
<p>This module provides an API to easily and programmatically build a virtual network
using <a class="reference external" href="http://mininet.org/">Mininet</a> as framework. It is an extension of <a class="reference external" href="https://github.com/mininet/mininet/blob/master/mininet/topo.py">mininet.topo</a>.
Here, you will find the documentation for all the methods that will help you
instantiate and start the network.</p>
<dl class="class">
<dt id="p4utils.mininetlib.network_API.NetworkAPI">
<em class="property">class </em><code class="descclassname">p4utils.mininetlib.network_API.</code><code class="descname">NetworkAPI</code><span class="sig-paren">(</span><em>*args</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L33-L2913"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">mininet.topo.Topo</span></code></p>
<p>Network definition and initialization API.</p>
<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.cli_enabled">
<code class="descname">cli_enabled</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.cli_enabled" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> – enable an extension to <em>Mininet</em> CLI after the network starts.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.hosts">
<code class="descname">hosts</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1975-L1988"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.hosts" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> – dictionary of host and their properties.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.sw_clients">
<code class="descname">sw_clients</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.sw_clients" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> – list of <em>Thrift</em> clients (one per P4 switch) to populate tables.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.compilers">
<code class="descname">compilers</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.compilers" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> – list of compiler instances (one per P4 source provided) to compile P4 code.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.net">
<code class="descname">net</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.net" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="xref py py-class docutils literal"><span class="pre">mininet.net.Mininet</span></code> – network instance implemented using an extension to <em>Mininet</em> network class.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.modules">
<code class="descname">modules</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.modules" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> – dictionary of external modules used by the API.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.ipv4_net">
<code class="descname">ipv4_net</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.ipv4_net" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">ipaddress.IPv4Network</span></code></a> – IPv4 network address generator (by default within the network <code class="docutils literal"><span class="pre">10.0.0.0/8</span></code>).
a different network can be specified using <a class="reference internal" href="#p4utils.mininetlib.network_API.NetworkAPI.setIpBase" title="p4utils.mininetlib.network_API.NetworkAPI.setIpBase"><code class="xref py py-meth docutils literal"><span class="pre">setIpBase()</span></code></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.topoFile">
<code class="descname">topoFile</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.topoFile" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> – path to the JSON topology database file.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.cpu_bridge">
<code class="descname">cpu_bridge</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.cpu_bridge" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a> – name of the bridge used to connect all the CPU ports of the P4 switches.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.auto_gw_arp">
<code class="descname">auto_gw_arp</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.auto_gw_arp" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> – automatically set gateways’ MAC in the ARP tables of each host.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.auto_arp_tables">
<code class="descname">auto_arp_tables</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.auto_arp_tables" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">bool</span></code></a> – automatically populate the ARP tables of each hosts with MACs from the other
hosts present in the same subnetwork.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.scripts">
<code class="descname">scripts</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.scripts" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">list</span></code></a> – list of script to execute in the main namespace.</p>
</dd></dl>

<dl class="attribute">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.tasks">
<code class="descname">tasks</code><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.tasks" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> – dictionary containing scheduled tasks.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addHost">
<code class="descname">addHost</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1946-L1962"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addHost" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds P4 host node to the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – host name</li>
<li><strong>**opts</strong> – host options (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">host name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addLink">
<code class="descname">addLink</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>port1=None</em>, <em>port2=None</em>, <em>key=None</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1157-L1295"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addLink" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds link between two nodes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>port1</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – port number on the first node (optional)</li>
<li><strong>port2</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – port number on the second node (optional)</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
<li><strong>**opts</strong> – link options as listed below (optional)</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>In particular, <strong>**opts</strong> can include the following:</p>
<ul class="simple">
<li><strong>intfName1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>): name of the interface of the first node</li>
<li><strong>intfName2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>): name of the interface of the second node</li>
<li><strong>addr1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>)    : MAC address of the interface of the first node</li>
<li><strong>addr2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">str</span></code></a>)    : MAC address of the interface of the second node</li>
<li><strong>weight</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>)   : weight used to compute shortest paths</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the next available number is used.
If not specified, all the optional fields are assigned automatically
by the method <code class="xref py py-meth docutils literal"><span class="pre">auto_assignment()</span></code> before the network is started.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The interface names <strong>must not</strong> be in the canonical format (i.e. <code class="docutils literal"><span class="pre">node-ethN</span></code>
where <code class="docutils literal"><span class="pre">N</span></code> is the port number of the interface) because the automatic
assignment uses it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addNode">
<code class="descname">addNode</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1650-L1664"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a node to the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>**opts</strong> (<em>kwargs</em>) – node options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">node name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addP4RuntimeSwitch">
<code class="descname">addP4RuntimeSwitch</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2382-L2398"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addP4RuntimeSwitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds P4 runtime switch node to Mininet topology.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4Runtime switch name</li>
<li><strong>**opts</strong> – switch options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">P4Runtime switch name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addP4Switch">
<code class="descname">addP4Switch</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2100-L2122"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addP4Switch" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds P4 switch node to the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – switch name</li>
<li><strong>opts</strong> (<em>kwargs</em>) – switch options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">P4 switch name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addRouter">
<code class="descname">addRouter</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2468-L2484"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addRouter" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a router node to the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – router name</li>
<li><strong>**opts</strong> – router options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">router name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addSwitch">
<code class="descname">addSwitch</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2029-L2052"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addSwitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds switch node to the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – switch name</li>
<li><strong>**opts</strong> – switch options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">switch name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addTask">
<code class="descname">addTask</code><span class="sig-paren">(</span><em>name</em>, <em>exe</em>, <em>start=0</em>, <em>duration=0</em>, <em>enableScheduler=True</em>, <em>args=()</em>, <em>kwargs={}</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1877-L1916"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addTask" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a task to the node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>exe</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/types.html#types.FunctionType" title="(in Python v3.10)"><em>types.FunctionType</em></a>) – executable to run (either a shell string
command or a Python function)</li>
<li><strong>start</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a>) – task delay in seconds with respect to the
network starting time.</li>
<li><strong>duration</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a>) – task duration time in seconds (if duration is
lower than or equal to <code class="docutils literal"><span class="pre">0</span></code>, then the task has no
time limitation)</li>
<li><strong>enableScheduler</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – whether to automatically enable the TaskServer or not</li>
<li><strong>args</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)"><em>tuple</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)"><em>list</em></a>) – positional arguments for the passed function</li>
<li><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><em>dict</em></a>) – key-word arguments for the passed function</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This method can automatically enable the task scheduler
(provided by the <a class="reference internal" href="p4utils.utils.task_scheduler.html#p4utils.utils.task_scheduler.TaskServer" title="p4utils.utils.task_scheduler.TaskServer"><code class="xref py py-class docutils literal"><span class="pre">TaskServer</span></code></a>)
on the node with the socket lacated in the default path, if it has not
been previously enabled.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addTaskFile">
<code class="descname">addTaskFile</code><span class="sig-paren">(</span><em>filepath</em>, <em>def_mod='p4utils.utils.traffic_utils'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1855-L1875"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addTaskFile" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds the tasks to the node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>filepath</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – tasks file path</li>
<li><strong>def_mod</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – default module where to look for Python functions</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>The file has to be a set of lines, where each one has the following syntax:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">node</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">start</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">duration</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">exe</span><span class="o">&gt;</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">arg1</span><span class="o">&gt;</span><span class="p">]</span> <span class="o">...</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">argN</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">mod</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span><span class="p">]</span> <span class="p">[</span><span class="o">--&lt;</span><span class="n">key1</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">kwarg1</span><span class="o">&gt;</span><span class="p">]</span> <span class="o">...</span> <span class="p">[</span><span class="o">--&lt;</span><span class="n">keyM</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">kwargM</span><span class="o">&gt;</span><span class="p">]</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">A non-default module can be specified in the command with <code class="docutils literal"><span class="pre">--mod</span> <span class="pre">&lt;module&gt;</span></code>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.addTofino">
<code class="descname">addTofino</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2439-L2455"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.addTofino" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds Tofino switch node to Mininet topology.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4Runtime switch name</li>
<li><strong>**opts</strong> – switch options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Tofino switch name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If a node with the same name is already present,
this method will overwrite it.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.areNeighbors">
<code class="descname">areNeighbors</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1930-L1943"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.areNeighbors" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if two node are neighbors.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>True</strong> if <em>node1</em> and <em>node2</em> are neighbors, <em>False</em> otherwise.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.deleteLink">
<code class="descname">deleteLink</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1355-L1375"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.deleteLink" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete link.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.deleteNode">
<code class="descname">deleteNode</code><span class="sig-paren">(</span><em>name</em>, <em>remove_links=True</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1705-L1719"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.deleteNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Deletes node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>remove_links</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – remove all the incident links</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.describeP4Nodes">
<code class="descname">describeP4Nodes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1027-L1033"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.describeP4Nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Prints a description for the P4 nodes in the network.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableArpTables">
<code class="descname">disableArpTables</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1068-L1072"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableArpTables" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the static ARP entries for hosts in the
same network.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableCli">
<code class="descname">disableCli</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1055-L1057"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableCli" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the Mininet client.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableCpuPort">
<code class="descname">disableCpuPort</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2343-L2363"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableCpuPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables CPU port on switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableCpuPortAll">
<code class="descname">disableCpuPortAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2376-L2379"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableCpuPortAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables CPU port on all the P4 switches.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableDebugger">
<code class="descname">disableDebugger</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2223-L2235"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableDebugger" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables debugger for the P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableDebuggerAll">
<code class="descname">disableDebuggerAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2246-L2253"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableDebuggerAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disable debugger for all the P4 switches.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableDhcp">
<code class="descname">disableDhcp</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2004-L2016"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableDhcp" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables DHCP server in hosts.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – host name</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.10)"><code class="xref py py-exc docutils literal"><span class="pre">Exception</span></code></a> – if the specified node is not a host.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableDhcpAll">
<code class="descname">disableDhcpAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2023-L2026"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableDhcpAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables DHCP for all the hosts.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableGwArp">
<code class="descname">disableGwArp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1083-L1087"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableGwArp" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the static ARP entry in hosts
for the gateway only.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableLog">
<code class="descname">disableLog</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1779-L1788"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableLog" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables log for node (also for its task scheduler).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableLogAll">
<code class="descname">disableLogAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1800-L1803"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableLogAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables log for all the nodes (also for the task schedulers).</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disablePcapDump">
<code class="descname">disablePcapDump</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2270-L2282"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disablePcapDump" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables generation of <code class="docutils literal"><span class="pre">.pcap</span></code> files for the P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the P4 switch</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disablePcapDumpAll">
<code class="descname">disablePcapDumpAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2296-L2303"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disablePcapDumpAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables generation of <code class="docutils literal"><span class="pre">.pcap</span></code> files for all the P4 switches.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableScheduler">
<code class="descname">disableScheduler</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1818-L1827"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableScheduler" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the task scheduler server for the node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.disableSchedulerAll">
<code class="descname">disableSchedulerAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1850-L1853"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.disableSchedulerAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Disables the task scheduler server for all the nodes.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableArpTables">
<code class="descname">enableArpTables</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1059-L1066"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableArpTables" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables the static ARP entries for hosts in the
same network.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This option is enabled by default.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableCli">
<code class="descname">enableCli</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1047-L1053"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableCli" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables the Mininet client.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This option is enabled by default.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableCpuPort">
<code class="descname">enableCpuPort</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2319-L2341"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableCpuPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables CPU port on switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This operation will create a new switch called <code class="docutils literal"><span class="pre">sw-cpu</span></code>. Should a node
with the same name exist, then it would be overwritten.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableCpuPortAll">
<code class="descname">enableCpuPortAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2365-L2374"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableCpuPortAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables CPU port on all the P4 switches.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This applies only to already defined switches. If other
switches are added after this command, they won’t have
any CPU port enabled.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableDebugger">
<code class="descname">enableDebugger</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2209-L2221"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableDebugger" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables debugger for the P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableDebuggerAll">
<code class="descname">enableDebuggerAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2237-L2244"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableDebuggerAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable debugger for all the P4 switches.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableDhcp">
<code class="descname">enableDhcp</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1990-L2002"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableDhcp" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables DHCP server in hosts.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – host name</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.10)"><code class="xref py py-exc docutils literal"><span class="pre">Exception</span></code></a> – if the specified node is not a host.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableDhcpAll">
<code class="descname">enableDhcpAll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2018-L2021"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableDhcpAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables DHCP for all the hosts.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableGwArp">
<code class="descname">enableGwArp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1074-L1081"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableGwArp" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables the static ARP entry in hosts
for the gateway only.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This option is enabled by default.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableLog">
<code class="descname">enableLog</code><span class="sig-paren">(</span><em>name</em>, <em>log_dir='./log'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1767-L1777"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableLog" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables log for node (also for its task scheduler).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>log_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the log directory</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableLogAll">
<code class="descname">enableLogAll</code><span class="sig-paren">(</span><em>log_dir='./log'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1790-L1798"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableLogAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables log for all the nodes (also for
their task schedulers).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>log_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the log directory</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enablePcapDump">
<code class="descname">enablePcapDump</code><span class="sig-paren">(</span><em>name</em>, <em>pcap_dir='./pcap'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2255-L2268"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enablePcapDump" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables generation of <code class="docutils literal"><span class="pre">.pcap</span></code> files for the P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</li>
<li><strong>pcap_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – where to save pcap files</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enablePcapDumpAll">
<code class="descname">enablePcapDumpAll</code><span class="sig-paren">(</span><em>pcap_dir='./pcap'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2284-L2294"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enablePcapDumpAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables generation of <code class="docutils literal"><span class="pre">.pcap</span></code> files for all the P4 switches.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pcap_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – where to save <code class="docutils literal"><span class="pre">.pcap</span></code> files</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For the default setting check out <a class="reference internal" href="p4utils.mininetlib.node.html#p4utils.mininetlib.node.P4Switch" title="p4utils.mininetlib.node.P4Switch"><code class="xref py py-class docutils literal"><span class="pre">P4Switch</span></code></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableScheduler">
<code class="descname">enableScheduler</code><span class="sig-paren">(</span><em>name</em>, <em>path='/tmp'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1805-L1816"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableScheduler" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables the task scheduler server for the node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – directory where the
socket file will be placed</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.enableSchedulerAll">
<code class="descname">enableSchedulerAll</code><span class="sig-paren">(</span><em>path='/tmp'</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1840-L1848"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.enableSchedulerAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Enables a task scheduler server for each node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the directory where the
socket files will be placed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.execScript">
<code class="descname">execScript</code><span class="sig-paren">(</span><em>cmd</em>, <em>out_file=None</em>, <em>reboot=True</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1014-L1025"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.execScript" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes the given command in the main namespace after
the network boot.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cmd</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – command to execute</li>
<li><strong>out_file</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – where to redirect <em>stdout</em> and <em>stderr</em></li>
<li><strong>reboot</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – rerun the script every time
all the P4 switches are rebooted.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.getLink">
<code class="descname">getLink</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1297-L1315"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.getLink" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns link metadata dictionary.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of second node</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
<dt><code class="docutils literal"><span class="pre">(link,</span> <span class="pre">key)</span></code> where <code class="docutils literal"><span class="pre">link</span></code> is a <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> containing all</dt>
<dd><p class="first last">the information about the link and <code class="docutils literal"><span class="pre">key</span></code> is the id of the link between
<strong>node1</strong> and <strong>node2</strong>.</p>
</dd>
</dl>
</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)">tuple</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.getNode">
<code class="descname">getNode</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1666-L1675"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.getNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets node information.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>node</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">node metadata.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)">dict</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.hasCpuPort">
<code class="descname">hasCpuPort</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2305-L2317"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.hasCpuPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the P4 Switch has a CPU port.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node has a CPU port, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.hasScheduler">
<code class="descname">hasScheduler</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1829-L1838"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.hasScheduler" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if a host has an active scheduler.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if the node has an active scheduler, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt>
<code class="descname">hosts</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1975-L1988"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Returns hosts.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort hosts alphabetically</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – retrieve node information</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(host</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isHost">
<code class="descname">isHost</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1964-L1973"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isHost" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if node is a host.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a host, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isNode">
<code class="descname">isNode</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1735-L1744"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if node exists.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node exists, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isP4RuntimeSwitch">
<code class="descname">isP4RuntimeSwitch</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2400-L2409"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isP4RuntimeSwitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if node is a P4Runtime switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a P4Runtime switch, else <strong>False</strong>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isP4Switch">
<code class="descname">isP4Switch</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2124-L2133"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isP4Switch" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the node is a P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a P4 switch, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isRouter">
<code class="descname">isRouter</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2486-L2495"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isRouter" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if a node is a router.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a router, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isSwitch">
<code class="descname">isSwitch</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2054-L2063"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isSwitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if node is a switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a switch, <strong>False</strong> otherwise.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.isTofino">
<code class="descname">isTofino</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2457-L2466"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.isTofino" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if node is a Tofino switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if node is a Tofino switch, else <strong>False</strong>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)">bool</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.l2">
<code class="descname">l2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2513-L2594"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.l2" title="Permalink to this definition">¶</a></dt>
<dd><p>Automated IP/MAC assignment strategy for already initialized
links and nodes. All the devices are placed inside the same
IPv4 network (<code class="docutils literal"><span class="pre">10.0.0.0/16</span></code>).</p>
<p><strong>Assumes</strong></p>
<ul class="simple">
<li>Each host is connected to exactly one switch.</li>
<li>Only switches and hosts are allowed.</li>
<li>Parallel links are not allowed.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Routers are not supported.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.l3">
<code class="descname">l3</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2754-L2913"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.l3" title="Permalink to this definition">¶</a></dt>
<dd><p>Automated IP/MAC assignment strategy for already initialized
links and nodes. All the hosts have a different subnetwork that is shared
with the fake IP address of the switch port they are connected to.</p>
<p><strong>Assumes</strong></p>
<ul class="simple">
<li>Each host is connected to exactly one switch.</li>
<li>Only switches and hosts are allowed.</li>
<li>Parallel links are not allowed.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Routers are not supported.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.links">
<code class="descname">links</code><span class="sig-paren">(</span><em>sort=False</em>, <em>withKeys=False</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1398-L1409"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.links" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns links with no duplicated edges. Every link is listed exactly once.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort links alphabetically</li>
<li><strong>withKeys</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – return link keys</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – return link info</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(src,</span> <span class="pre">dst</span> <span class="pre">[,</span> <span class="pre">key,</span> <span class="pre">info</span> <span class="pre">])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.mixed">
<code class="descname">mixed</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2596-L2752"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.mixed" title="Permalink to this definition">¶</a></dt>
<dd><p>Automated IP/MAC assignment strategy for already initialized
links and nodes. All the hosts connected to the same switch are placed
in the same subnetwork. Different switches (even those linked
together) are placed in different subnetworks.</p>
<p><strong>Assumes</strong></p>
<ul class="simple">
<li>Each host is connected to exactly one switch.</li>
<li>Only switches and hosts are allowed.</li>
<li>Parallel links are not allowed.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Routers are not supported.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.nodes">
<code class="descname">nodes</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1746-L1765"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all the nodes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort nodes alphabetically</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – retrieve node information</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(node</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.p4rtswitches">
<code class="descname">p4rtswitches</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2411-L2424"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.p4rtswitches" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns P4Runtime switches.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort switches alphabetically</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – retrieve node information</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(p4runtimeswitch</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.p4switches">
<code class="descname">p4switches</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2135-L2148"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.p4switches" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns P4 switches.</p>
<blockquote>
<div><dl class="docutils">
<dt>Args:</dt>
<dd>sort (bool)    : sort switches alphabetically
withInfo (bool): retrieve node information</dd>
</dl>
</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of <code class="docutils literal"><span class="pre">(p4switch</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.popLink">
<code class="descname">popLink</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1377-L1396"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.popLink" title="Permalink to this definition">¶</a></dt>
<dd><p>Pops link.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><dl class="docutils">
<dt><code class="docutils literal"><span class="pre">(link,</span> <span class="pre">key)</span></code> where <code class="docutils literal"><span class="pre">link</span></code> is a <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)"><code class="xref py py-class docutils literal"><span class="pre">dict</span></code></a> containing all</dt>
<dd><p class="first last">the information about the link and <code class="docutils literal"><span class="pre">key</span></code> is the id of the link between
<strong>node1</strong> and <strong>node2</strong>.</p>
</dd>
</dl>
</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.10)">tuple</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.popNode">
<code class="descname">popNode</code><span class="sig-paren">(</span><em>name</em>, <em>remove_links=True</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1721-L1733"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.popNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Pops node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>remove_links</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – remove all the incident links</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">node metadata.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.10)">dict</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.printPortMapping">
<code class="descname">printPortMapping</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1002-L1012"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.printPortMapping" title="Permalink to this definition">¶</a></dt>
<dd><p>Prints the port mapping of all the devices.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.routers">
<code class="descname">routers</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2497-L2510"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.routers" title="Permalink to this definition">¶</a></dt>
<dd><p>Return routers.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort routers alphabetically</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – retrieve node information</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(router</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setBw">
<code class="descname">setBw</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>bw</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1411-L1430"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setBw" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets link bandwidth.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the fist node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>bw</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – bandwidth (in Mbps)</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setBwAll">
<code class="descname">setBwAll</code><span class="sig-paren">(</span><em>bw</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1590-L1602"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setBwAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets bandwidth for all the links currently in the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>bw</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a>) – bandwidth (in Mbps)</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This only sets the bandwidth of the links that have been already
added to the topology: those added after this method is called will
not meet this setting.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setCompiler">
<code class="descname">setCompiler</code><span class="sig-paren">(</span><em>compilerClass=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L946-L962"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setCompiler" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the default P4 compiler class and options.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>compilerClass</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.10)"><em>type</em></a>) – compiler class to use for the compilation
of P4 code</li>
<li><strong>**kwargs</strong> – key-word arguments to pass to the compiler
object when it is first instantiated</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">One can provide both <code class="docutils literal"><span class="pre">compilerClass</span></code> and <code class="docutils literal"><span class="pre">**kwargs</span></code> or only one
of them (e.g. one may want to use the default compiler
<a class="reference internal" href="p4utils.utils.compiler.html#p4utils.utils.compiler.P4C" title="p4utils.utils.compiler.P4C"><code class="xref py py-class docutils literal"><span class="pre">P4C</span></code></a> and pass some parameters to it).</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setDefaultRoute">
<code class="descname">setDefaultRoute</code><span class="sig-paren">(</span><em>name</em>, <em>default_route</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1918-L1928"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setDefaultRoute" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the node’s default route.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the node</li>
<li><strong>default_route</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – default route IP</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setDelay">
<code class="descname">setDelay</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>delay</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1432-L1452"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setDelay" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets link delay.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>delay</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – transmission delay (in ms)</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setDelayAll">
<code class="descname">setDelayAll</code><span class="sig-paren">(</span><em>delay</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1604-L1616"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setDelayAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets delay for all the links currently in the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>delay</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – transmission delay (in ms)</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This only sets the delay of the links that have been already
added to the topology: those added after this method is called will
not meet this setting.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setGrpcPort">
<code class="descname">setGrpcPort</code><span class="sig-paren">(</span><em>name</em>, <em>port</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2426-L2436"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setGrpcPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the gRPC port number for the P4Runtime switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the P4 runtime switch</li>
<li><strong>port</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – gRPC port number</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setIntfIp">
<code class="descname">setIntfIp</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>ip</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1548-L1570"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setIntfIp" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets IP of <em>node1</em>’s interface facing <em>node2</em> with the specified key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>ip</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – IP address/mask to configure</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setIntfMac">
<code class="descname">setIntfMac</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>mac</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1572-L1588"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setIntfMac" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets MAC of <em>node1</em>’s interface facing <em>node2</em> with the specified key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>mac</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – MAC address to configure</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setIntfName">
<code class="descname">setIntfName</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>intfName</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1503-L1524"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setIntfName" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets name of <em>node1</em>’s interface facing <em>node2</em> with the specified key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>intfName</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the interface</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setIntfPort">
<code class="descname">setIntfPort</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>port</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1526-L1546"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setIntfPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets port number of <em>node1</em>’s interface facing <em>node2</em> with the specified key.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>port</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – name of the interface</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setIpBase">
<code class="descname">setIpBase</code><span class="sig-paren">(</span><em>ipBase</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L931-L944"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setIpBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the network in which all the L3 devices will be placed
if no explicit assignment is performed (e.g. assignment strategies
or manual assignment).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ipBase</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – IP address / mask (e.g. <code class="docutils literal"><span class="pre">10.0.0.0/8</span></code>)</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Remember that setting the IP base won’t automatically change
the already assigned IP. If you want to specify a different network,
please use this method before any node is added to the network.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setLogLevel">
<code class="descname">setLogLevel</code><span class="sig-paren">(</span><em>logLevel</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L913-L929"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setLogLevel" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the log level for the execution.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>logLevel</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – level of logging detail.</td>
</tr>
</tbody>
</table>
<p>Possible <strong>logLevel</strong> values are the follwing (in
decreasing order of detail):</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">debug</span></code></li>
<li><code class="docutils literal"><span class="pre">info</span></code></li>
<li><code class="docutils literal"><span class="pre">output</span></code></li>
<li><code class="docutils literal"><span class="pre">warning</span></code></li>
<li><code class="docutils literal"><span class="pre">error</span></code></li>
<li><code class="docutils literal"><span class="pre">critical</span></code></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setLoss">
<code class="descname">setLoss</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>loss</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1454-L1478"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setLoss" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets link loss.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>loss</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a>) – packet loss rate (e.g. <code class="docutils literal"><span class="pre">0.5</span></code> means that 50% of
packets will exeperience a loss)</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setLossAll">
<code class="descname">setLossAll</code><span class="sig-paren">(</span><em>loss</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1618-L1631"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setLossAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets loss for all the links currently in the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>loss</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.10)"><em>float</em></a>) – packet loss rate (e.g. <code class="docutils literal"><span class="pre">0.5</span></code> means that 50% of
packets will exeperience a loss)</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This only sets the loss rate of the links that have been already
added to the topology: those added after this method is called will
not meet this setting.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setMaxQueueSize">
<code class="descname">setMaxQueueSize</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>max_queue_size</em>, <em>key=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1480-L1501"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setMaxQueueSize" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets link max queue size.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>max_queue_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – maximum number of packets the qdisc may
hold queued at a time.</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setMaxQueueSizeAll">
<code class="descname">setMaxQueueSizeAll</code><span class="sig-paren">(</span><em>max_queue_size</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1633-L1646"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setMaxQueueSizeAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets max queue size for all the links currently in the network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>max_queue_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – maximum number of packets the <code class="docutils literal"><span class="pre">qdisc</span></code>
may hold queued at a time.</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This only sets the max queue size of the links that have been already
added to the topology: those added after this method is called will
not meet this setting.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setNet">
<code class="descname">setNet</code><span class="sig-paren">(</span><em>netClass=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L964-L980"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setNet" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the default network class and options.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>netClass</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.10)"><em>type</em></a>) – network class to use for the orchestration</li>
<li><strong>**kwargs</strong> – key-word arguments to pass to the network
object when it is first instantiated</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">One can provide both <code class="docutils literal"><span class="pre">netClass</span></code> and <code class="docutils literal"><span class="pre">**kwargs</span></code> or only one
of them (e.g. one may want to use the default network
<a class="reference internal" href="p4utils.mininetlib.net.html#p4utils.mininetlib.net.P4Mininet" title="p4utils.mininetlib.net.P4Mininet"><code class="xref py py-class docutils literal"><span class="pre">P4Mininet</span></code></a> and pass some
parameters to it).</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setP4CliInput">
<code class="descname">setP4CliInput</code><span class="sig-paren">(</span><em>name</em>, <em>cli_input</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2171-L2183"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setP4CliInput" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the path to the command line configuration file for
a <em>Thrift</em> capable P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</li>
<li><strong>cli_input</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the command line configuration
file</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setP4Source">
<code class="descname">setP4Source</code><span class="sig-paren">(</span><em>name</em>, <em>p4_src</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2150-L2160"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setP4Source" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the P4 source for the switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</li>
<li><strong>p4_src</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the P4 source file</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setP4SourceAll">
<code class="descname">setP4SourceAll</code><span class="sig-paren">(</span><em>p4_src</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2162-L2169"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setP4SourceAll" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the same P4 source for all the P4 switches.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>p4_src</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the P4 file</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setP4SwitchId">
<code class="descname">setP4SwitchId</code><span class="sig-paren">(</span><em>name</em>, <em>id</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2185-L2195"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setP4SwitchId" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets P4 Switch ID.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</li>
<li><strong>id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – P4 switch ID</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setSwitchClient">
<code class="descname">setSwitchClient</code><span class="sig-paren">(</span><em>swclientClass=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L982-L999"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setSwitchClient" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the default switch client class and options.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>swclientClass</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.10)"><em>type</em></a>) – Thrift client class to use for the
the control plane configuration</li>
<li><strong>**kwargs</strong> – key-word arguments to pass to the client
object when it is first instantiated</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">One can provide both <code class="docutils literal"><span class="pre">swclientClass</span></code> and <code class="docutils literal"><span class="pre">**kwargs</span></code> or only one
of them (e.g. one may want to use the default client
<a class="reference internal" href="p4utils.utils.client.html#p4utils.utils.client.ThriftClient" title="p4utils.utils.client.ThriftClient"><code class="xref py py-class docutils literal"><span class="pre">ThriftClient</span></code></a> and pass
some parameters to it).</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setSwitchDpid">
<code class="descname">setSwitchDpid</code><span class="sig-paren">(</span><em>name</em>, <em>dpid</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2080-L2097"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setSwitchDpid" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets Switch DPID.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the P4 switch</li>
<li><strong>dpid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – switch DPID (16 hexadecimal characters)</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This method only applies to non P4 switches
since P4 switches’ DPIDs are determined by their IDs.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setThriftPort">
<code class="descname">setThriftPort</code><span class="sig-paren">(</span><em>name</em>, <em>port</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2197-L2207"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setThriftPort" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the <em>Thrift</em> port number for the P4 switch.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – P4 switch name</li>
<li><strong>port</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – <em>Thrift</em> port number</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.setTopologyFile">
<code class="descname">setTopologyFile</code><span class="sig-paren">(</span><em>topoFile</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1035-L1045"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.setTopologyFile" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the file where the topology will be saved for subsequent
queries in the exercises.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>topoFile</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – path to the topology database file</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The topology database is stored in <code class="docutils literal"><span class="pre">./topology.json</span></code> by default.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.startNetwork">
<code class="descname">startNetwork</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1089-L1138"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.startNetwork" title="Permalink to this definition">¶</a></dt>
<dd><p>Starts and configures the network.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.stopNetwork">
<code class="descname">stopNetwork</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1145-L1151"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.stopNetwork" title="Permalink to this definition">¶</a></dt>
<dd><p>Stops the network.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.stop_exec_scripts">
<code class="descname">stop_exec_scripts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1140-L1143"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.stop_exec_scripts" title="Permalink to this definition">¶</a></dt>
<dd><p>Stops all exec scripts.</p>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.switches">
<code class="descname">switches</code><span class="sig-paren">(</span><em>sort=True</em>, <em>withInfo=False</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L2065-L2078"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.switches" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns switches.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>sort</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – sort switches alphabetically</li>
<li><strong>withInfo</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.10)"><em>bool</em></a>) – retrieve node information</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of <code class="docutils literal"><span class="pre">(switch</span> <span class="pre">[,</span> <span class="pre">info])</span></code>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.10)">list</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.updateLink">
<code class="descname">updateLink</code><span class="sig-paren">(</span><em>node1</em>, <em>node2</em>, <em>key=None</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1317-L1353"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.updateLink" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates link metadata dictionary. In fact, delete the node
and create a new one with the updated information.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>node1</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the first node</li>
<li><strong>node2</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – name of the second node</li>
<li><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)"><em>int</em></a>) – id used to identify multiple edges which
link two same nodes (optional)</li>
<li><strong>**opts</strong> – link options to update (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>key</strong> of the link between <strong>node1</strong> and <strong>node2</strong>.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.10)">int</a></p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If <code class="docutils literal"><span class="pre">key</span></code> is <strong>None</strong>, then the link with the lowest key value is considered.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="p4utils.mininetlib.network_API.NetworkAPI.updateNode">
<code class="descname">updateNode</code><span class="sig-paren">(</span><em>name</em>, <em>**opts</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/nsg-ethz/p4-utils/tree/master/p4utils/mininetlib/network_API.py#L1677-L1703"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#p4utils.mininetlib.network_API.NetworkAPI.updateNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates node metadata dictionary. In fact, it deletes the node
and creates a new one with the updated information.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)"><em>str</em></a>) – node name</li>
<li><strong>**opts</strong> – node options to update (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">node name.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.10)">str</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="p4utils.mininetlib.net.html" class="btn btn-neutral float-left" title="p4utils.mininetlib.net module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="p4utils.mininetlib.node.html" class="btn btn-neutral float-right" title="p4utils.mininetlib.node module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2021, Networked Systems Group (NSG@ETH).</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>